<?php
class dt_rol extends toba_datos_tabla
{
	function get_descripciones()
	{
		$sql = "SELECT id_rol, rol FROM rol ORDER BY rol";
		return toba::db('sapes')->consultar($sql);
	}



	function get_listado($filtro=array())
	{
		$where = array();
		if (isset($filtro['rol'])) {
			$where[] = "rol ILIKE ".quote("%{$filtro['rol']}%");
		}
		$sql = "SELECT
			t_r.id_rol,
			t_r.rol
		FROM
			rol as t_r
		ORDER BY rol";
		if (count($where)>0) {
			$sql = sql_concatenar_where($sql, $where);
		}
		return toba::db('sapes')->consultar($sql);
	}




}
?>